{% extends 'index.html' %}
{% block title %}
<title>借阅管理</title>
{% endblock %}


{% block con %}
<div class="widget am-cf">
    <div class="widget-head am-cf">
        <div class="widget-title  am-cf">图书列表</div>
    </div>
    <div class="widget-body  am-fr">

        <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
            <div class="am-form-group">
                <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                        <a href="/book/add" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
            <div class="am-form-group tpl-table-list-select">
                <select name="types" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                  <option value="title" >书名</option>
                  <option value="suthor">作者</option>
                </select>
            </div>
        </div>
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
            <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                <input type="text" class="am-form-field ">
                <span class="am-input-group-btn">
                    <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button"></button>
                  </span>
            </div>
        </div>

        <div class="am-u-sm-12">
            <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                <thead>
                    <tr>
                        <th>ID号</th>
                        <th>借阅者</th>
                        <th>ISBN</th>
                        <th>借阅时间</th>
                        <th>应还时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for v in data %}
                    <tr class="gradeX">
                        <td class="am-text-middle">{{ v.id }}</td>
                        <td class="am-text-middle">{{ v.openid }}</td>
                        <td class="am-text-middle">{{ v.isbn }}</td>
                        <td class="am-text-middle">{{ v.starttime }}</td>
                        <td class="am-text-middle">{{ v.endtime }}</td>
                        <td class="am-text-middle">
                            <div class="tpl-table-black-operation">                                            
                                <a href="javascript:;" class="tpl-table-black-operation-del">
                                    <i class="am-icon-trash"></i> 详情
                                </a>
                            </div>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        <div class="am-u-lg-12 am-cf">

            <div class="am-fr">

                <ul class="am-pagination tpl-pagination">
                    <li><a href="/?page={{ paginate.prev_num }}">«</a></li>

                    {%  for i in  paginate.iter_pages() %}
                        <!-- 如果 i=page 显示高亮 -->
                        {% if i==page %}
                        <li class="am-active"><a href="/?page={{ i }}">{{ i }}</a></li>
                        <!-- 如果 i != page 不显高亮 -->
                        {% else %}
                        <li><a href="/?page={{ i }}">{{ i }}</a></li>
                        {% endif %}

                    {% endfor %}

                    <li><a href="/?page={{ paginate.next_num }}">»</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>    
    
{% endblock %}
